home *** CD-ROM | disk | FTP | other *** search
- <%@ Language=VBScript CODEPAGE=65001 %>
- <!--#include file="include/wmsLocStrings.inc"-->
- <!--#include file="include/wmsServerHash.inc"-->
- <!--#include file="include/wmsPlugins.inc"-->
- <!--#include file="include/wmsHeader.inc"-->
- <!--#include file="include/wmsPageBanner.inc"-->
- <!--#include file="include/wmsError.inc"-->
- <!--#include file="plugin_loading.inc"-->
- <%
- '+-------------------------------------------------------------------------
- '
- ' Microsoft Windows Media
- ' Copyright (C) Microsoft Corporation. All rights reserved.
- '
- ' File: Plugin_Action.asp
- '
- ' Contents:
- '
- '--------------------------------------------------------------------------
-
- ConnectToPlugin
- ClearError
- Dim strPluginIndex
- strPluginIndex = qs( "pluginIndex" )
- strPluginIndex = Left( strPluginIndex, 50 ) ' fail-safe
-
- on error resume next
-
- select case qs("op")
- case "disable"
- DisablePlugin FALSE
- case "remove"
- RemovePlugin
- case "properties"
- RedirectToProperties
- case "refresh"
- RefreshPluginList
- case Else
- Response.Redirect( "..\..\admin.asp?server=" & g_strQueryStringServer & "&category=" & g_strCategory & "&ppID=" & g_strPubPointID & "&pluginIndex=" & strPluginIndex )
- end select
-
-
- '//////////////////////////////////////////////////////////////////////////
- Sub RefreshPluginList()
- on error resume next
- g_objPluginCollection.Refresh
-
- if( TRUE = IsEmpty( g_objPubPoint ) ) then
- Response.Redirect( "../server_props.asp?server=" & g_strQueryStringServer & "&category=" & qs("category") & "&pluginIndex=" & strPluginIndex & "&op=refresh" )
- else
- Response.Redirect( "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & qs("category") & "&pluginIndex=" & strPluginIndex & "&op=refresh" )
- end if
- Response.Flush
- end Sub
-
- '//////////////////////////////////////////////////////////////////////////
- Sub DisablePlugin( bRedirectedFromRemove )
- on error resume next
- Dim strQueryStringSuffix
- Dim szPrompted
- Dim bPluginInError
-
- szPrompted = CStr( trim( qs( "prompted" ) ) )
- strQueryStringSuffix = "&s=true"
-
- bPluginInError = ( 0 <> ( CInt( WMS_PLUGIN_ERROR ) and g_objPlugin.Status ) )
-
- if( ( TRUE = g_objPlugin.Enabled ) or ( TRUE = bPluginInError ) ) then
-
- if ( TRUE = bPluginInError ) then
- strQueryStringSuffix = strQueryStringSuffix & "&prompted=yes"
- g_objPlugin.Enabled = FALSE
- else
- if( "" = qs("result") ) or ( TRUE = bRedirectedFromRemove ) then
- Dim szCritical
- szCritical = g_objPlugin.Properties( "WMSCriticalSystemPlugin" )
- Err.Clear
- if( 1 <> szCritical )then ' straight-forward Remove operation
- g_objPlugin.Enabled = FALSE
- if( 0 <> err.number ) then
- ' ugly but necessary
- Session( "ErrDisablePluginDesc" ) = err.Description
- Session( "DisableError" ) = CDbl( err.number )
- strQueryStringSuffix = strQueryStringSuffix & "&op=disable"
- end if
-
- if( TRUE = IsEmpty( g_objPubPoint ) ) then
- Response.Redirect( "../server_props.asp?server=" & g_strQueryStringServer & "&category=" & qs("category") & strQueryStringSuffix & "&pluginIndex=" & strPluginIndex )
- else
- Response.Redirect( "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & qs("category") & strQueryStringSuffix & "&pluginIndex=" & strPluginIndex )
- end if
- end if
- end if
-
- if( bRedirectedFromRemove ) then
- szReferrer = "&path=" & Server.URLPathEncode( "/wmssecure/pages/plugins/plugin_action.asp" )
- Response.Redirect( "../alert.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & qs("category") & "&pluginIndex=" & strPluginIndex & "&op=" & OP_DISABLECRITSYSPLUGIN & szReferrer )
- elseif( "0" = trim( qs("result") ) ) then ' we've already prompted the user, and they just wanted to disable the plug-in
- ' Ask if they want to disable a critical system plug-in
- strQueryStringSuffix = strQueryStringSuffix & "&prompted=yes"
- g_objPlugin.Enabled = FALSE
- elseif( "1" = trim( qs("result") ) ) then
- strQueryStringSuffix = strQueryStringSuffix & "&prompted=yes"
- else
- szReferrer = "&path=" & Server.URLPathEncode( "/wmssecure/pages/plugins/plugin_action.asp" )
- Response.Redirect( "../alert.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & qs("category") & "&pluginIndex=" & strPluginIndex & "&op=" & OP_DISABLECRITSYSPLUGIN & szReferrer )
- end if
- end if
- end if
-
- if( TRUE = IsEmpty( g_objPubPoint ) ) then
- Response.Redirect( "../server_props.asp?server=" & g_strQueryStringServer & "&category=" & qs("category") & "&op=disable" & strQueryStringSuffix & "&pluginIndex=" & strPluginIndex )
- else
- Response.Redirect( "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & qs("category") & "&op=disable" & strQueryStringSuffix & "&pluginIndex=" & strPluginIndex )
- end if
- Response.Flush
- end sub
-
-
- '//////////////////////////////////////////////////////////////////////////
- Sub RemovePlugin()
- on error resume next
- Dim strQueryStringSuffix
- Dim bPluginInError
- bPluginInError = FALSE
-
- strQueryStringSuffix = ""
-
- g_objPluginCollection.Remove( g_strPluginName )
-
- ' We cannot remove the last instance of a type of plugin.
- if( 0 <> err.number )then
- strQueryStringSuffix = CStr( "&op=remove" )
- Session( "RemoveError" ) = "remove"
- err.clear
- if( 0 = StrComp( "0", trim( qs("result") ), vbTextCompare ) )then ' we've already prompted the user, and they just wanted to disable the plug-in
- DisablePlugin TRUE
- Exit Sub
- g_objPlugin.Enabled = FALSE
- strQueryStringSuffix = strQueryStringSuffix & "&prompted=yes"
- elseif( 0 = Len( trim( qs( "result" ) ) ) )then
- if( bPluginInError or ( TRUE = g_objPlugin.Enabled ) )then ' ask if they just want to disable the plug-in
- szReferrer = "&path=" & Server.URLPathEncode( "/wmssecure/pages/plugins/plugin_action.asp" )
- Response.Redirect( "../alert.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & qs("category") & "&pluginIndex=" & strPluginIndex & "&op=" & OP_REMOVE_PLUGINERRDIS & szReferrer )
- end if
- else
- strQueryStringSuffix = strQueryStringSuffix & "&prompted=yes"
- end if
- else
- strQueryStringSuffix = CStr( "" )
- end if
-
- if( TRUE = IsEmpty( g_objPubPoint ) ) then
- Response.Redirect( "../server_props.asp?server=" & g_strQueryStringServer & "&ppID=&category=" & qs("category") & "&pluginIndex=" & strPluginIndex & strQueryStringSuffix )
- else
- Response.Redirect( "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & qs("category") & "&pluginIndex=" & strPluginIndex & strQueryStringSuffix )
- end if
- Response.Flush
- end sub
-
-
- '//////////////////////////////////////////////////////////////////////////
- sub RedirectToProperties
- on error resume next
-
- Dim strRedirect
- Dim bAdminPageExists
- Dim strArguments
-
- strArguments = "?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&referrer=" & Server.URLEncode( qs("referrer") ) & "&pendingOp=" & qs("pendingOp")
- strRedirect = g_objPlugin.Properties("ASPMoniker")
- bAdminPageExists = CBool( 0 < Len( strRedirect ) )
-
- if( bAdminPageExists ) then
- bAdminPageExists = CBool( 0 < Len( Server.MapPath( strRedirect ) ) )
- end if
-
- if( bAdminPageExists and ( 0 = err.number ) ) then
- strRedirect = strRedirect & strArguments & "&pluginIndex=" & strPluginIndex
- Response.Redirect( strRedirect )
- else
- if( empty = g_objPubPoint ) then
- Response.Redirect( "../server_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&pluginIndex=" & strPluginIndex & "&err=nopluginui" & "&pendingOp=" & qs("pendingOp") )
- else
- Response.Redirect( "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&pluginIndex=" & strPluginIndex & "&err=nopluginui" & "&pendingOp=" & qs("pendingOp") )
- end if
- Response.Flush
- ' Response.End
- end if
- end sub
-
- on error resume next
- PluginsASPCleanup
- strPluginIndex = nothing
- ClearError
- %>